package com.lynn.mmcc.user.dao.impl;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.orm.hibernate3.HibernateTemplate;

import com.lynn.mmcc.user.dao.RoomDao;

public class RoomDaoImpl  implements RoomDao{

	 private JdbcTemplate jdbcTemplate;

	 private HibernateTemplate hibernateTemplate;

	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}


	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}


	public HibernateTemplate getHibernateTemplate() {
		return hibernateTemplate;
	}


	public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
		this.hibernateTemplate = hibernateTemplate;
	}


	/**
	 * 更新状态
	 */
	public String updateState(String userID) {
		String resultcode = "";
		String sql = "update t_sns_userservice set BINDSTATUS=3 where USERID=?";
		try {
			this.getJdbcTemplate().update(sql, new Object[] { userID });
			resultcode = "0";
		} catch (Exception e) {
			resultcode = "1";
			e.printStackTrace();
		}
		return resultcode;
	}
}
